<?php defined('IN_IA') or exit('Access Denied');?><!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <title>选择供灯</title>
    <script type="text/javascript" src="<?php echo MODULE_URL;?>public/deng/js/flexible.js"></script>
    <script type="text/javascript" src="<?php echo MODULE_URL;?>public/deng/js/pageLoading.js"></script>
    <link type="text/css" rel="stylesheet" href="<?php echo MODULE_URL;?>public/deng/css/indexSelect.css">
</head>
<body>
<div class="selectLight">
    <img src="<?php echo MODULE_URL;?>public/deng/images/icon_lamp1.png" alt="灯"/>
</div>
<div class="selectText"><p class="textName">光明灯</p><span class="priceName"></span></div>
<div class="contentAll">
    <div class="contentSel">
        <p class="conTitle">【供奉菩萨为不动尊菩萨】</p>
        <span>光明灯代表心中有信仰，以及对光明的渴望。光明灯是一盏照亮前程的祈福灯！</span>
        <p class="selUser">【适用对象】：求学业光明，事业通达，财运亨通，婚姻美满者</p>
    </div>
    <a href="<?php  echo $this->createMobileUrl('gongdeng3')?>" class="lightHref" ></a>
    <input name="cid" id="cid" type="hidden" value="22" />
    <input name="price" id="price" type="hidden" value="0.00" />
</div>
<div class="selectUl">
    <ul>
        <li class="active" data-cid="22" data-price="0.00"><span>光明灯</span></li><li  data-cid="26" data-price="0.00"><span>平安灯</span></li><li  data-cid="24" data-price="0.00"><span>健康灯</span></li><li  data-cid="21" data-price="0.00"><span>招财灯</span></li><li  data-cid="25" data-price="0.00"><span>学业灯</span></li><li  data-cid="23" data-price="0.00"><span>事业灯</span></li><li  data-cid="20" data-price="0.00"><span>姻缘灯</span></li><li  data-cid="28" data-price="0.00"><span>求子灯</span></li><li  data-cid="29" data-price="0.00"><span>生辰灯</span></li><li  data-cid="27" data-price="0.00"><span>忏悔灯</span></li>
    </ul>
</div>

<script type="text/javascript" src="<?php echo MODULE_URL;?>public/deng/js/zepto.min.js"></script>
<script type="text/javascript">
    $(function(){
        var selcetValue = [
            {
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp1.png',
                Name:'光明灯',
                Price:'',
                textTitle:'【供奉菩萨为不动尊菩萨】',
                Content:'光明灯代表心中有信仰，以及对光明的渴望。光明灯是一盏照亮前程的祈福灯！',
                User:'【适用对象】：求学业光明，事业通达，财运亨通，婚姻美满者'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp10.png',
                Name:'平安灯',
                Price:'',
                textTitle:'【供奉菩萨为地藏菩萨】',
                Content:'平安灯用来祈求平安顺利，可保佑自己或为他人祈福，是传播衷心祝愿和友好的表现。',
                User:'【适用对象】：所有需要关怀和祝福的人，尤其是不在身边的亲友和身陷困境的世人。'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp3.png',
                Name:'健康灯',
                Price:'',
                textTitle:'【供奉菩萨为药师佛菩萨】',
                Content:'健康灯用于祈求身体安康，生活愉悦，延年益寿。病者可祈求早日康复，健康成长',
                User:'【适用对象】：自已或者亲朋好友，年长，年幼者特别是身体欠安者'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp2.png',
                Name:'招财灯',
                Price:'',
                textTitle:'【供奉菩萨为财宝天王】',
                Content:'招财灯用于祈求财神眷顾，生意兴隆昌盛，财源滚滚',
                User:'【适用对象】：创业者，投资者，求财者'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp5.png',
                Name:'学业灯',
                Price:'',
                textTitle:'【供奉菩萨为文殊菩萨】',
                Content:'智慧灯由象征聪明智慧的菩萨守护您，让您生智开悟。考生应试者在考前要点亮智慧灯，以祈求金榜题名。功成名就！',
                User:'【适用对象】：学生，考生，求职者'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp4.png',
                Name:'事业灯',
                Price:'',
                textTitle:'【供奉菩萨为准提菩萨】',
                Content:'事业灯用于祈求事业腾飞，职场人际关系和谐，让事业步步高升',
                User:'【适用对象】：求职者，想升职加薪者，开创事业者等。'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp6.png',
                Name:'姻缘灯',
                Price:'',
                textTitle:'【供奉菩萨为爱染明王】',
                Content:'姻缘灯是月老给我们的恩赐。点亮姻缘灯可祈求恋爱甜蜜，有情人终成眷属；夫妻恩爱，婚姻幸福美满。',
                User:'【适用对象】：单身者、有伴侣者'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp8.png',
                Name:'求子灯',
                Price:'',
                textTitle:'【供奉菩萨为求子观音】',
                Content:'求子灯让希望求子的父母，可以向上天传达求子的心愿，让有缘的孩子早日来报道！',
                User:'【适用对象】：渴望求子的家庭或者父母'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp9.png',
                Name:'生辰灯',
                Price:'',
                textTitle:'【供奉菩萨为观世音菩萨】',
                Content:'生日代表小运势转变。亲友或者自己过生日时点一盏生辰灯，祈愿生辰快乐，在新的一岁里好运多多',
                User:'【适用对象】：即将过生日的亲朋好友，自己等'
            },{
                Img:'<?php echo MODULE_URL;?>public/deng/images/icon_lamp7.png',
                Name:'忏悔灯',
                Price:'',
                textTitle:'【供奉菩萨为普贤菩萨】',
                Content:'忏悔灯用来谨慎功过，诚心思悔，时时反省求进步！',
                User:'【适用对象】：希望能诚心改善陋习，过错的自己'
            },        	];

        $(".selectUl ul li").on('tap',function(){
            $(this).addClass('active').siblings().removeClass('active');
            var _index = $(this).index();
            //alert(_index);
            var Img = selcetValue[_index].Img;
            Name = selcetValue[_index].Name;
            Price = selcetValue[_index].Price;
            textTitle = selcetValue[_index].textTitle;
            Content = selcetValue[_index].Content;
            User = selcetValue[_index].User;
            var valueT = $(".selectText").text();
            $(".priceName").text(Price);
            $(".textName").text(Name);
            $(".selectLight>img").attr('src',Img);
            $(".conTitle").text(textTitle);
            $(".contentSel>span").text(Content);
            $(".selUser").text(User);

            var cid   = $(this).attr('data-cid');
            var price = $(this).attr('data-price');
            $('#cid').val(cid);
            $('#price').val(price);
        });

        $(".nav>li").on('tap', function(e){
            e.stopPropagation();
            var index = $(this).index();
            $(this).addClass('on').siblings().removeClass('on');

        });
        $(".dropA").on('tap',function(){
            if (!$('.dropdown').hasClass('downOn')) {
                $('.dropdown').addClass('downOn');
            }else{
                $('.dropdown').removeClass('downOn');
            }
        })
        $(document).on('tap', function(e){
            var obj = e.target;
            if (!$(obj).is('.dropdown, .dropdown *')) {
                $('.dropdown').removeClass('downOn');
            }
        });

        $('.lightHref').one('click',function(){
            var cid = $.trim($('#cid').val());
            var price = $('#price').val();

            if(price>0){  //进入微信支付

                location.href = 'index.php?g=Wap&m=Gongdeng&a=toPayLight&total='+price+'&cid='+cid+'&token=yimjsw1467078121&ispay=1';

            }else{
                var flag = true;
                if(flag==false) return false;
                $.post("/index.php?g=Wap&m=Gongdeng&a=toGongdeng",{cid:cid},function(rs){
                    if(rs.code==200){
                        location.href = 'index.php?g=Wap&m=Gongdeng&a=index&pid='+rs.lastID+'&isback=1&token=yimjsw1467078121';
                        flag = false;
                    }
                },'json');
            }
        });
    });
</script>
 <?php (!empty($this) && $this instanceof WeModuleSite) ? (include $this->template('baifocommon/nav', TEMPLATE_INCLUDEPATH)) : (include template('baifocommon/nav', TEMPLATE_INCLUDEPATH));?>
</body>
</html>